Linux Deep Guide (हिन्दी) — Open Source OS, Features, File Structure, Components, Shell और 21 Commands
1. ओपन सोर्स ऑपरेटिंग सिस्टम — परिभाषा (Definition)
ओपन सोर्स ऑपरेटिंग सिस्टम वे OS होते हैं जिनका सोर्स कोड सार्वजनिक रूप से उपलब्ध होता है। इसका अर्थ यह है कि कोई भी डेवलपर या उपयोगकर्ता उस कोड को देख सकता है, संशोधित कर सकता है और अपनी जरुरत के अनुसार पुनः वितरित कर सकता है। ओपन सोर्स सॉफ़्टवेयर समुदाय के सहयोग से विकसित होते हैं और आमतौर पर मुफ्त (free) होते हैं।
Key Features (मुख्य विशेषताएँ)
- फ्री उपलब्धता: लाइसेंस के अनुसार स्रोत कोड मुफ्त में उपलब्ध होता है।
- कस्टमाइज़ेशन: आप अपने उद्देश्य के अनुसार OS को बदल सकते हैं।
- सुरक्षा: सार्वजनिक समीक्षा के कारण बग जल्दी पकड़े और सुधारे जाते हैं।
- कम्युनिटी सपोर्ट: दुनिया भर के डेवलपर्स सहयोग करते हैं — पैच और अपडेट तेजी से आते हैं।
2. Linux Operating System — परिचय (Introduction)
Linux एक Unix-like open-source OS है जिसका kernel Linus Torvalds ने 1991 में बनाया। Linux केवल kernel नहीं है — सामान्यतः यह kernel + userspace utilities का समूह (distribution) के रूप में आता है (जैसे Ubuntu, Debian, Fedora, CentOS आदि)। Linux एक Multi-user, Multi-tasking और Multi-threading सिस्टम है और सर्वरों से लेकर मोबाइल (Android kernel), embedded devices तक व्यापक उपयोग में आता है।
Linux के उपयोग (Usage)
- Servers: वेब सर्वर, डेटाबेस सर्वर, मेल सर्वर, application servers।
- Supercomputers: दुनिया के अधिकांश सुपरकंप्यूटर Linux पर चलते हैं।
- Mobile: Android का kernel Linux पर आधारित है।
- Embedded devices: राउटर, IoT डिवाइस, स्मार्ट टीवी आदि।
3. Linux की विशेषताएँ (Features of Linux)
- Open Source: Source उपलब्ध और audit-able।
- Security: UNIX-style permissions, SELinux/AppArmor और strong network stack।
- Multi-user & Multi-tasking: एकाधिक उपयोगकर्ता और प्रक्रियाएँ समान समय में।
- Stability & Performance: servers के लिए highly stable और efficient।
- Portability: बहु-हार्डवेयर प्लेटफ़ॉर्म पर compile किया जा सकता है।
- Large Ecosystem: पैकेज मैनेजर्स, dev tools, containerization (Docker), orchestration (Kubernetes)।
4. Linux File Structure (लिनक्स फाइल सिस्टम संरचना)
Linux का फाइल सिस्टम hierarchical tree के रूप में होता है जिसकी जड़ /
(root) होती है। नीचे प्रमुख directories और उनका अर्थ दिया गया है:
Directory | Description (विवरण) |
---|---|
/ | Root — फ़ाइल सिस्टम की जड़ |
/bin | Essential user binaries (ls, cp, mv) |
/sbin | System binaries (fdisk, systemctl — आमतौर पर root उपयोग के लिए) |
/etc | Configuration files (system, service configs) |
/var | Variable data — logs, spool files |
/usr | User programs and libraries (read-only shareable) |
/home | User home directories (/home/username) |
/root | Root user का home directory |
/tmp | Temporary files (often cleared on reboot) |
/dev | Device files (block/character devices) |
/proc | Virtual filesystem for kernel & process info |
/sys | sysfs — kernel devices & attributes |
/mnt / /media | Mount points for temporary mounts / removable media |
5. Linux में File Names (फाइल नामकरण)
Linux में filenames और naming conventions के कुछ महत्वपूर्ण बिंदु:
- Case-sensitive:
File.txt
औरfile.txt
अलग फाइलें हैं। - Extensions: Extension आवश्यक नहीं — executable files भी बिना extension के हो सकते हैं।
- Hidden files: Dot से शुरू होने वाली फाइलें छिपी मानती हैं — เช่น
.bashrc
। - Allowed characters: सामान्यतः letters, numbers, underscores, hyphens और dots; spaces तक allowed हैं पर अनुशंसित नहीं।
- Length limits: Filesystem पर निर्भर करता है (आम तौर पर 255 bytes per filename for ext4)।
6. Components of Linux OS (मुख्य घटक)
Kernel
Linux kernel hardware abstraction, process scheduling, memory management, device drivers, filesystem handling और network stack संभालता है। Kernel monolithic design पर आधारित है पर loadable modules का समर्थन करता है (LKM)।
System Libraries & User-space
Glibc जैसी libraries system calls और standard functions provide करती हैं। User-space में shell, utilities (coreutils), daemons और applications होते हैं।
Other Components
- Init/System manager: systemd (या SysV init) — services/units को manage करता है।
- Shell & Command-line tools: bash, zsh, coreutils (ls, cp, mv, rm)।
- Package manager: apt, yum/dnf, pacman — software install/update के लिए।
7. Shell (शेल) क्या है?
Shell एक command-line interpreter है जो user से command लेता है, उसे kernel को भेजता है और output दिखाता है। Shell scripting से automation possible है।
प्रसिद्ध Shells
- Bash (Bourne Again Shell): सबसे सामान्य और default कई distributions में।
- Zsh: बेहतर interactive features, plugins (oh-my-zsh)।
- Ksh, Tcsh, Fish: अन्य विकल्प अलग features के साथ।
Shell का कार्य
- Command parsing और execution
- Input/Output redirection (>, >>, <)
- Pipelines (|) और job control (&, fg, bg)
- Shell scripting और automation
8. बेसिक Linux Commands — 21 commands (Detailed)
नीचे दिए गए हर कमांड में syntax, short explanation और example है। आप इन्हें terminal में आज़मा सकते हैं।
1. pwd
— Present Working Directory
Syntax: pwd
Explanation: यह current directory का absolute path दिखाता है।
$ pwd
/home/raj
2. ls
— List directory contents
Syntax: ls [options] [path]
Explanation: किसी directory के files और subdirectories दिखाता है।
$ ls -la
drwxr-xr-x 2 raj raj 4096 Aug 10 10:00 .
-rw-r--r-- 1 raj raj 120 Aug 10 09:45 file.txt
3. cd
— Change Directory
Syntax: cd [directory]
Explanation: working directory बदलता है।
$ cd /var/log
$ pwd
/var/log
4. mkdir
— Make Directory
Syntax: mkdir [options] directory
Explanation: नई directory बनाता है।
$ mkdir project
$ ls -d project
project
5. rmdir
— Remove Directory (empty)
Syntax: rmdir directory
Explanation: खाली directory हटाता है। अगर directory खाली नहीं है तो error देगा।
$ rmdir olddir
6. touch
— Create empty file / update timestamp
Syntax: touch filename
Explanation: नई खाली file बनाता है या file का modification time update करता है।
$ touch notes.txt
$ ls -l notes.txt
-rw-r--r-- 1 raj raj 0 Aug 10 11:00 notes.txt
7. cat
— Concatenate and display files
Syntax: cat filename
Explanation: file content terminal पर दिखाता है।
$ cat notes.txt
This is my note.
8. cp
— Copy files and directories
Syntax: cp [options] source destination
Example:
$ cp file.txt /tmp/
# directory copy (recursive)
$ cp -r mydir /backup/
9. mv
— Move or rename files
Syntax: mv source destination
Explanation: file को relocate या rename करता है।
$ mv file.txt file_old.txt
$ mv file.txt /home/raj/documents/
10. rm
— Remove files or directories
Syntax: rm [options] file
Warning: सावधानी से उपयोग करें — deleted files generally recoverable नहीं होतीं।
$ rm file_old.txt
# recursive delete (dangerous)
$ rm -rf mydir/
11. man
— Manual pages
Syntax: man command
Explanation: किसी भी command की manual page खोलता है — usage, options, examples मिलते हैं।
$ man ls
12. chmod
— Change file permissions
Syntax: chmod [mode] file
Examples:
# numeric
$ chmod 755 script.sh
# symbolic
$ chmod u+x script.sh
13. chown
— Change file owner/group
Syntax: chown owner:group file
$ sudo chown raj:developers project.txt
14. echo
— Display a line of text
Syntax: echo [text]
$ echo "Hello Linux"
Hello Linux
15. whoami
— Show current user
Syntax: whoami
$ whoami
raj
16. uname
— Show system information
Syntax: uname -a
$ uname -a
Linux myhost 5.15.0-... #1 SMP ... x86_64 GNU/Linux
17. df
— Report file system disk space usage
Syntax: df -h
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 10G 37G 21% /
18. du
— Estimate file / directory space usage
Syntax: du -sh folder/
$ du -sh /var/log
120M /var/log
19. ps
— Report process status
Syntax: ps aux
$ ps aux | grep nginx
www-data 1234 0.1 2.5 ... /usr/sbin/nginx
20. kill
— Send signal to process
Syntax: kill PID
or kill -9 PID
$ kill 1234
# force kill
$ kill -9 1234
21. exit
— Exit the shell
Syntax: exit
Explanation: current shell session बंद करता है (logout) — script में exit को return code के साथ भी use करते हैं।
$ exit
man
pages पढ़ें और एक sandbox VM में practice करें। उदाहरणों में sudo आवश्यकता हो सकती है — बेझिझक सीखते समय सुरक्षित test environment का उपयोग करें।
9. छोटे-छोटे उपयोगी Tips और Best Practices
- Production system पर changes करने से पहले backup लें और commands test करें।
- Files और directories को meaningful नाम दें (no spaces recommended — use hyphen/underscore)।
- Use
ssh-key
authentication for secure remote access, avoid password-only login. - Regular updates और security patches के लिए package manager का प्रयोग करें।
- Logs को monitor करने के लिए
journalctl
औरtail -f /var/log/*
का उपयोग करें।
FAQ — अक्सर पूछे जाने वाले प्रश्न
Linux क्या है?
Linux एक open-source, Unix-like operating system है। इसका kernel Linus Torvalds ने 1991 में बनाया।
Filenames case-sensitive क्यों होते हैं?
Unix heritage के कारण Linux case-sensitive है — यह flexibility देता है लेकिन ध्यान रखकर filenames रखनी चाहिए।
मैं कहाँ practice कर सकता/सकती हूँ?
VirtualBox/VMware में Ubuntu/Debian VM बनाकर, या cloud free-tier (AWS/GCP/Azure) पर small instance पर practice कर सकते हैं।
Post a Comment
How Can I Help You Welcome